﻿<div ng-controller="app.views.useredit as vm">
    <!-- BEGIN PAGE BREADCRUMB -->
    <ul class="page-breadcrumb breadcrumb">
        <li>
            <a href="#/">主页</a><i class="fa fa-circle"></i>
        </li>
        <li>
            <a href="#">系统设置</a>
            <i class="fa fa-circle"></i>
        </li>
        <li>
            <a href="#/UserManage">用户管理</a>
            <i class="fa fa-circle"></i>
        </li>
        <li class="active">
            管理指定租户下的用户
        </li>
    </ul>
    <!-- END PAGE BREADCRUMB -->
    <!-- BEGIN PAGE CONTENT INNER -->
    <div class="portlet light">
        <div class="portlet-body">
            <div class="row">
                <div class="col-md-4">
                    <div class="portlet light bordered">
                        <div class="portlet-title">
                            <div class="caption">
                                @*<i class="icon-equalizer font-red-sunglo"></i>*@
                                <span class="caption-subject font-red-sunglo bold uppercase">用户编辑</span>
                                @*<span class="caption-helper">请编辑角信息</span>*@
                            </div>
                            <div class="actions ">


                                <button type="button" ng-click="submit()" class="btn btn-small green" ng-disabled="userForm.$invalid">保存</button>
                                <button type="button" onclick="history.back()" class="btn btn-small default">取消</button>

                                <button type="button" ng-show="userModel.id" ng-click="delete()" class="btn btn-small red">删除</button>

                            </div>
                        </div>

                        <div class="portlet-title">
                            <div class="caption">
                                <ul class="nav nav-tabs">
                                    <li class="active">
                                        <a href="#" data-target="#tab_userinfo" data-toggle="tab">
                                            基本信息
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#" data-target="#tab_grantrole" data-toggle="tab">
                                            授权角色
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="tab-content">

                            <div class="tab-pane fade active in" id="tab_userinfo">
                                <div>
                                    <div class="portlet-body form">
                                        <!-- BEGIN FORM-->
                                        <form action="javascript:;" class="form-horizontal" name="userForm" ng-submit="submit()">

                                            <div class="form-body">
                                                <div class="form-group">
                                                    <input type="hidden" name="tenantId" ng-model="userModel.tenantId" />
                                                    <label class="col-md-4 control-label">用户名</label>
                                                    <div class="col-md-8">
                                                        <input type="text" name="name" ng-model="userModel.name" required ng-minlength="2" ng-maxlength="50" class="form-control" placeholder="名称">
                                                        <span class="has-error" ng-show="userForm.name.$error">
                                                            <span ng-show="userForm.name.$error.minlength" class="help-block">该字段太短了.</span>
                                                            <span ng-show="userForm.name.$error.maxlength" class="help-block">该字段太长了.</span>
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label">昵称</label>
                                                    <div class="col-md-8">
                                                        @*<div class="input-group">*@
                                                        <input type="text" name="surname" ng-model="userModel.surname" required ng-minlength="2" ng-maxlength=50 class="form-control" placeholder="租户名字">
                                                        <span class="has-error" ng-show="userForm.surname.$error">
                                                            <span ng-show="userForm.surname.$error.minlength" class="help-block">该字段太短了.</span>
                                                            <span ng-show="userForm.surname.$error.maxlength" class="help-block">该字段太长了.</span>
                                                        </span>
                                                        @*</div>*@
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label">登录名</label>
                                                    <div class="col-md-8">
                                                        @*<div class="input-group">*@
                                                        <input type="text" name="userName" ng-model="userModel.userName" required ng-minlength="2" ng-maxlength=50 class="form-control" placeholder="租户名字">
                                                        <span class="has-error" ng-show="userForm.userName.$error">
                                                            <span ng-show="userForm.userName.$error.minlength" class="help-block">该字段太短了.</span>
                                                            <span ng-show="userForm.userName.$error.maxlength" class="help-block">该字段太长了.</span>
                                                        </span>
                                                        @*</div>*@
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label">邮箱</label>
                                                    <div class="col-md-8">
                                                        @*<div class="input-group">*@
                                                        <input type="text" name="emailAddress" ng-model="userModel.emailAddress" required ng-minlength="2" ng-maxlength=50 class="form-control" placeholder="租户名字">
                                                        <span class="has-error" ng-show="userForm.emailAddress.$error">
                                                            <span ng-show="userForm.emailAddress.$error.minlength" class="help-block">该字段太短了.</span>
                                                            <span ng-show="userForm.emailAddress.$error.maxlength" class="help-block">该字段太长了.</span>
                                                        </span>
                                                        @*</div>*@
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label">邮箱验证过</label>
                                                    <div class="col-md-8">
                                                        <select ng-model="userModel.isEmailConfirmed" name="isEmailConfirmed" required ng-options="state.id as state.text for state in states" class="form-control"></select>
                                                        <span class="has-error" ng-show="userForm.isActive.$error">
                                                            <span ng-show="userForm.isEmailConfirmed.$error.required" class="help-block">该字段必选.</span>
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-md-4 control-label">是否激活</label>
                                                    <div class="col-md-8">
                                                        <select ng-model="userModel.isActive" name="isActive" required ng-options="state.id as state.text for state in states" class="form-control"></select>
                                                        <span class="has-error" ng-show="userForm.isActive.$error">
                                                            <span ng-show="userForm.isActive.$error.required" class="help-block">该字段必选.</span>
                                                        </span>
                                                    </div>
                                                </div>
                                                @*<div class="form-actions">
                                                        <div class="row">
                                                            <div class="col-md-offset-3 col-md-9">
                                                                <div class="row">
                                                                    <div class="col-md-8">
                                                                        <button type="submit" class="btn green" ng-disabled="userForm.$invalid">保存</button>
                                                                        <button type="button" onclick="history.back()" class="btn default">取消</button>
                                                                    </div>
                                                                    <div class="col-md-1">
                                                                        <button type="button" ng-show="userModel.id" ng-click="delete()" class="btn red">删除</button>
                                                                    </div>
                                                                </div>


                                                            </div>
                                                        </div>
                                                    </div>*@
                                            </div>
                                        </form>
                                        <!-- END FORM-->
                                    </div>
                                </div>
                            </div>
                            <div class="tab-pane fade" id="tab_grantrole">

                                <div id="tree_roles">

                                </div>

                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-md-8">
                    <div class="portlet light">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-cogs font-green-sharp"></i>
                                <span class="caption-subject font-green-sharp bold uppercase">权限列表</span>
                                <span class="caption-helper">选择角色权限并保存</span>
                            </div>
                            <div class="actions col-md-offset-3 col-md-3">
                                <a href="javascript:;" ng-click="reSetUserPermissions()" class="btn btn-small yellow">重置权限</a>
                                <a href="javascript:;" ng-click="saveUserPermissions()" class="btn btn-small green">保存权限</a>
                            </div>
                            <div class="tools">

                                @*<a href="javascript:;" class="collapse" data-original-title="" title="">
                                    </a>
                                    <a href="#portlet-config" data-toggle="modal" class="config" data-original-title="" title="">
                                    </a>
                                    <a href="javascript:;" class="reload" data-original-title="" title="">
                                    </a>
                                    <a href="javascript:;" class="remove" data-original-title="" title="">
                                    </a>*@
                            </div>
                        </div>
                        <div class="portlet-body">
                            <div id="tree_permissions">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


</div>
